package com.syaccp.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.syaccp.model.TExchargePackage;
import com.syaccp.model.TWithdrawalDetails;
import com.syaccp.service.TExchargePackageService;
import com.syaccp.utils.Result;
import lombok.Data;
import lombok.SneakyThrows;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hsx
 * @since 2023-07-23
 */
@CrossOrigin
@RestController
@RequestMapping("/aaa")
public class TExchargePackageController {

    @Resource
    private TExchargePackageService tExchargePackageService;


    //查询充值包
    @GetMapping("/list")
    public Result list(TExchargePackage tExchargePackage) throws SQLException {
             List<TExchargePackage> tExchargePackages = tExchargePackageService.TopUpPack(tExchargePackage);
        return Result.success(tExchargePackages);
    }

    //创建充值包
    @PostMapping("/save")
    public Result save(@RequestBody TExchargePackage tExchargePackage){
        return tExchargePackageService.save(tExchargePackage)?Result.success():Result.fail();
    }









}
